package zkk.com.mengqu.models;

import android.util.Log;

import java.util.Arrays;

/**
 * Created by Administrator on 2017/6/1.
 */
public class Food {
    private int id;//菜品id
    private int kid;//厨房id
    private String name;//菜品名字
    private int score;//用户评分
    private double price;//价格
    private int remain;//剩余份数
    private String detail;//描述
    private String dishPicture;//菜品图片路径，用逗号分割
    private String createTime;//创建时间
    private int count;//自定义-购买数量

    //提交订单
    public Food(String name, double price, int count) {
        this.name = name;
        this.price = price;
        this.count = count;
    }

    public Food(int id, int kid, String name, int score, double price, int remain, String detail, String dishPicture, String createTime, int count) {
        this.id = id;
        this.kid = kid;
        this.name = name;
        this.score = score;
        this.price = price;
        this.remain = remain;
        this.detail = detail;
        this.dishPicture = dishPicture;
        this.createTime = createTime;
        this.count = count;
    }

    public Food(String string){
        String[] str = string.split(",");
        Log.w("Food",""+ Arrays.toString(str));
        Log.w("DeshesListSize",""+str[2]);
        this.id = Integer.parseInt(str[0]);
        this.kid = Integer.parseInt(str[1]);
        this.name = str[2];
        this.score = Integer.parseInt(str[3]);
        this.price = Double.parseDouble(str[4]);
        this.remain = Integer.parseInt(str[5]);
        this.detail = str[6];
        this.dishPicture = str[7];
        this.createTime = str[8];
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getKid() {
        return kid;
    }

    public void setKid(int kid) {
        this.kid = kid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getRemain() {
        return remain;
    }

    public void setRemain(int remain) {
        this.remain = remain;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String describe) {
        this.detail = detail;
    }

    public String getDishPicture() {
        return dishPicture;
    }

    public void setDishPicture(String dishPicture) {
        this.dishPicture = dishPicture;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return id+","+kid+","+name+","+score+","+price+","+remain+","+detail+","+dishPicture+","+createTime+","+count;
    }
}